package com.google.code.tretris.server;

import com.google.code.tretris.common.Tetromino;
import com.google.code.tretris.common.WKC;

public class ActiveTetromino {
	private Tetromino tetromino;
	private int rotation;
	private int x;
	private int y;
	private int halfTetronimoWidth;

	public ActiveTetromino(Tetromino tetromino) {
		this.tetromino = tetromino;
		this.halfTetronimoWidth = tetromino.width / 2;
		this.x = 5 - halfTetronimoWidth;
		this.y = 0;
		this.rotation = 0;
	}

	public int getRotation() {
		return rotation;
	}

	public void setRotation(int rotation) {
		this.rotation = rotation;
	}

	public int getX() {
		return x;
	}


	public void setX(int x) {
		this.x = x;			
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}

	public Tetromino getTetromino() {
		return tetromino;
	}

	@Override
	public String toString() {
		return tetromino.letter + "," + x + "," + y + "," + rotation;
	}
}
